package tako.wisers.com.android.apis.handler;

import tako.wisers.com.android.apis.activity.Tako;
import tako.wisers.com.android.apis.event.Event;
import tako.wisers.com.android.apis.util.Global;

public class MapSwitchHandler extends TakoHandler {

	private Event mEvent;
	
	public MapSwitchHandler(Tako tako) {
		super(tako);
	}

	public void execute(Event event) {
		mEvent = event;
		if(tako.getBottomDisplay() != Global.MAP_DISPLAY){
			mhandler.sendMessage(mhandler.obtainMessage());
			tako.setBottomDisplay(Global.MAP_DISPLAY);
		}
	}
	
	private android.os.Handler mhandler = new android.os.Handler() {
		@Override
		public void handleMessage(android.os.Message msg) {
			tako.switchDisplay(Global.MAP_DISPLAY);
			if(mEvent.isDismissDialog()){
				tako.dismissDialog();
			}
		}
	};

}
